﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WinForm101_EventHandler
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            // Create the event handler programmatically.
            button4.Click += new EventHandler(single_Click);

            button5.Click += new EventHandler(single_Click);
            button5.Click += new EventHandler(second_Click);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("button1 is clicked");
        }

        private void button2_Click(object sender, EventArgs e)
        {

        }

        private void button3_Click(object sender, EventArgs e)
        {

        }

        private void single_Click(object sender, EventArgs e)
        {
            MessageBox.Show("single click");
        }

        private void second_Click(Object sender, EventArgs e)
        {
            MessageBox.Show("second click");
        }
    }
}
